﻿<%@ Page Title="" Language="C#" MasterPageFile="Site.Master" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="ResearchRepository.RRRegister" %>

<asp:Content ID="registerHead" ContentPlaceHolderID="pageHead" runat="server">
	<title>
		Register
	</title>
</asp:Content>

<asp:Content ID="registerContent" ContentPlaceHolderID="pageContent" runat="server">
	<br />
	<table ID="registrationTable" runat="server" class="registerTable">
		<tr>
			<td>
				*E-Mail:
			</td>
			<td>
				<asp:TextBox ID="emailtext" runat="server" Columns="50" MaxLength="320"></asp:TextBox>
				<asp:RequiredFieldValidator runat="server" ControlToValidate="emailtext" ValidationGroup="registerValidation"
						ErrorMessage="<span style='color:#FF0000'>*</span>">
				</asp:RequiredFieldValidator>
				<asp:RegularExpressionValidator runat="server" ControlToValidate="emailtext" ValidationGroup="registerValidation"
						ErrorMessage="<span style='color:#FF0000'>The e-mail address given is not valid.</span>"
						ValidationExpression="^[a-zA-Z_\!\#\$\%\&\*\+\-\=\?\~\.]{1,64}@[a-zA-Z0-9_\.]{1,255}$">
				</asp:RegularExpressionValidator>
			</td>
		</tr>
		<tr>
			<td>
				Prefix Titles:
			</td>
			<td>
				<asp:TextBox ID="prefixtext" runat="server" Columns="30" MaxLength="30"></asp:TextBox>&nbsp Ex: Mr., Ms., Dr.
				<asp:RegularExpressionValidator runat="server" ControlToValidate="prefixtext" ValidationGroup="registerValidation"
						ErrorMessage="<span style='color:#FF0000'>Only letters, commas, periods and spaces are allowed.</span>"
						ValidationExpression="^[a-zA-Z\,\. ]*$">
				</asp:RegularExpressionValidator>
			</td>
		</tr>
		<tr>
			<td>
				*First Name:
			</td>
			<td>
				<asp:TextBox ID="firsttext" runat="server" Columns="30" MaxLength="30"></asp:TextBox>
				<asp:RequiredFieldValidator runat="server" ControlToValidate="firsttext" ValidationGroup="registerValidation"
						ErrorMessage="<span style='color:#FF0000'>*</span>">
				</asp:RequiredFieldValidator>
				<asp:RegularExpressionValidator runat="server" ControlToValidate="firsttext" ValidationGroup="registerValidation"
						ErrorMessage="<span style='color:#FF0000'>Only letters, dashes, periods and spaces are allowed.</span>" 
						ValidationExpression="^[a-zA-Z\-\. ]+$">
				</asp:RegularExpressionValidator>
			</td>
		</tr>
		<tr>
			<td>
				Middle Name:
			</td>
			<td>
				<asp:TextBox ID="midtext" runat="server" Columns="30" MaxLength="30"></asp:TextBox>
				<asp:RegularExpressionValidator runat="server" ControlToValidate="midtext" ValidationGroup="registerValidation"
						ErrorMessage="<span style='color:#FF0000'>Only letters, dashes, periods and spaces are allowed.</span>"
						ValidationExpression="^[a-zA-Z\-\. ]*$">
				</asp:RegularExpressionValidator>
			</td>
		</tr>
		<tr>
			<td>
				*Last Name:
			</td>
			<td>
				<asp:TextBox ID="lasttext" runat="server" Columns="30" MaxLength="30"></asp:TextBox>
				<asp:RequiredFieldValidator runat="server" ControlToValidate="lasttext" ValidationGroup="registerValidation"
						ErrorMessage="<span style='color:#FF0000'>*</span>">
				</asp:RequiredFieldValidator>
				<asp:RegularExpressionValidator runat="server" ControlToValidate="lasttext" ValidationGroup="registerValidation"
						ErrorMessage="<span style='color:#FF0000'>Only letters, dashes, and spaces are allowed.</span>"
						ValidationExpression="^[a-zA-Z\- ]+$">
				</asp:RegularExpressionValidator>
			</td>
		</tr>
		<tr>
			<td>
				Postfix Titles:
			</td>
			<td>
				<asp:TextBox ID="postfixtext" runat="server" Columns="30" MaxLength="30"></asp:TextBox>&nbsp Ex: PhD, Esq.
				<asp:RegularExpressionValidator runat="server" ControlToValidate="postfixtext" ValidationGroup="registerValidation"
						ErrorMessage="<span style='color:#FF0000'>Only letters, commas, periods and spaces are allowed.</span>"
						ValidationExpression="^[a-zA-Z\,\. ]*$">
				</asp:RegularExpressionValidator>
			</td>
		</tr>
		<tr>
			<td>
				University:
			</td>
			<td>
				<br />
				<asp:RadioButton ID="universitynone" runat="server" Text="None" Checked="true" GroupName="university" OnCheckedChanged= "OnClickUniversity" AutoPostBack="true"/> <br />
				<asp:RadioButton ID="universityfromlist" runat="server" Text="From List" GroupName="university" OnCheckedChanged= "OnClickUniversity" AutoPostBack="true"/> <br />
				<asp:RadioButton ID="universitynew" runat="server" Text="New University" GroupName="university" OnCheckedChanged= "OnClickUniversity" AutoPostBack="true"/> <br />
				<asp:DropDownList ID="universitydrop" runat="server" Visible="false" DataTextField="UnivName" DataValueField="UnivId" OnSelectedIndexChanged="OnSelectUniversity" AutoPostBack="true"></asp:DropDownList>
				<div ID="newUniversityDiv" runat="server" Visible="false">
					<asp:Label ID="universitylabel" runat="server" Text="Name: "></asp:Label>
					<asp:TextBox ID="universitynewtext" runat="server" Columns="50" MaxLength="100"></asp:TextBox>
					<asp:RequiredFieldValidator runat="server" ControlToValidate="universitynewtext" ValidationGroup="registerValidation"
							ErrorMessage="<span style='color:#FF0000'>*</span>">
					</asp:RequiredFieldValidator>
					<asp:RegularExpressionValidator runat="server" ControlToValidate="universitynewtext" ValidationGroup="registerValidation"
							ErrorMessage="<span style='color:#FF0000'>Only letters, commas, dashes, periods and spaces are allowed.</span>"
							ValidationExpression="^[a-zA-Z,\-\. ]+$">
					</asp:RegularExpressionValidator>
				</div>
				<br />
			</td>
		</tr>
		<tr ID="departmentRow" runat="server" visible="false">
			<td>
				<asp:Label ID="departmentmain" runat="server" Text="Department:"></asp:Label>
			</td>
			<td>
				<br />
				<asp:RadioButton ID="departmentnone" runat="server" Text="None" Checked="true" GroupName="department" OnCheckedChanged="OnClickDepartment" AutoPostBack="true" /> <br />
				<asp:RadioButton ID="departmentfromlist" runat="server" Text="From List" GroupName="department" OnCheckedChanged="OnClickDepartment" AutoPostBack="true" /> <br />
				<asp:RadioButton ID="departmentnew" runat="server" Text="New Department" GroupName="department" OnCheckedChanged="OnClickDepartment" AutoPostBack="true"/> <br />
				<asp:DropDownList ID="departmentdrop" runat="server" Visible="false" DataTextField="DeptName" DataValueField="DeptId"></asp:DropDownList>
				<div ID="newDepartmentDiv" runat="server" Visible="false">
					<asp:Label ID="departmentlabel" runat="server" Text="Name: "></asp:Label>
					<asp:TextBox ID="departmentnewtext" runat="server" Columns="50" MaxLength="100"></asp:TextBox>
					<asp:RequiredFieldValidator runat="server" ControlToValidate="departmentnewtext" ValidationGroup="registerValidation"
							ErrorMessage="<span style='color:#FF0000'>*</span>">
					</asp:RequiredFieldValidator>
					<asp:RegularExpressionValidator runat="server" ControlToValidate="departmentnewtext" ValidationGroup="registerValidation"
							ErrorMessage="<span style='color:#FF0000'>Only letters, commas, dashes, periods and spaces are allowed.</span>"
							ValidationExpression="^[a-zA-Z,\-\. ]+$">
					</asp:RegularExpressionValidator>
				</div>
			</td>
		</tr>
		<tr>
			<td>
				Submission Note:
			</td>
			<td>
				<asp:TextBox ID="notetext" runat="server" Columns="50" Rows="5" TextMode="MultiLine" MaxLength="65536" ></asp:TextBox>
			</td>
		</tr>
		<tr>
			<td>
			</td>
			<td>
				<br />
				<div class="registerInfo">
				Your registration will be reviewed by an administrator before being completed. You will be notified of their decision at the above the e-mail address. If accepted, a random password will be generated for you which you may change later via your 'Account' page.
				</div>
				<br />
				<asp:Button ID="registersubmit" runat="server" Text="Submit" ValidationGroup="registerValidation" OnClick="OnClickSubmit"/>
			</td>
		</tr>
	</table>

	<div ID="successDiv" runat="server" visible="false">
		Your registration request has been submitted successfully and an additional confirmation e-mail has been sent to '<%= emailtext.Text %>'.
	</div>
	<div ID="failureDiv" runat="server" visible="false">
		Your registration request has not been submitted due to a server error.
	</div>
	
</asp:Content>